package com.kukudb.asaproject.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@TableName("users")
@Data
public class User  {

    @TableId(type = IdType.AUTO)
    private Integer userId;
    @NotBlank(message = "用户名不能为空")
    @TableField("user_name") // MyBatis Plus 的字段映射注解（替换 JPA 的 @Column）
    private String userName;
    @NotBlank(message = "密码不能为空")
    @TableField("password")
    private String password;
    @Email(message = "邮箱格式不正确")
    @TableField("email")
    private String email;
    @TableField("role")
    private String role;
    @TableField("created_at")
    private Date createdAt;
    @TableField("last_login")
    private Date lastLogin;
}